<?php

namespace app\model\platform;

use app\BaseModel;
use app\model\RatingScaleFactorModel;
use app\model\RatingScaleModel;
use think\model\relation\BelongsTo;

/**
 * 区域-任务预警连评
 */
class PlatformTaskContinuousEvaluationModel extends BaseModel
{
    protected $name = 'platform_task_continuous_evaluation';

    /**
     * 关联量表
     * @return BelongsTo
     */
    public function RatingScale(): BelongsTo
    {
        return $this->belongsTo(RatingScaleModel::class, 'rating_scale_id')->bind([
            'rating_scale_name' => 'name',
        ]);
    }

    /**
     * 关联量表-联评
     * @return BelongsTo
     */
    public function ContinuityRatingScale(): BelongsTo
    {
        return $this->belongsTo(RatingScaleModel::class, 'continuity_rating_scale_id')->bind([
            'continuity_rating_scale_name' => 'name',
        ]);
    }

    /**
     * 关联量表因子
     * @return BelongsTo
     */
    public function RatingScaleFactor(): BelongsTo
    {
        return $this->belongsTo(RatingScaleFactorModel::class,  'factor_id')->bind([
            'factor_name' => 'name',
        ]);
    }
}